package leetcode.力扣竞赛.第98场双周赛;

import java.util.HashSet;

/**
 * 最小无法得到的或值
 *
 * @author: yan
 * @description:
 * @create: 2023-02-20 17:18
 **/
public class Solution2568 {
    public static void main(String[] args) {
        int[] arr = new int[]{1,2,3};
        minImpossibleOR(arr);
    }
    public static int minImpossibleOR(int[] nums) {
        HashSet<Integer> set = new HashSet<>();
        for (int num : nums) {
            set.add(num);
        }
        for (int i = 1;; i *= 2) {
            if (!set.contains(i)) {
                return i;
            }
        }
    }
}
